package com.laf.manage.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
/**
 * 物品状态
 */
@Getter
public enum ItemStatusEnum {
    ALL(0, "全部"),
    WAIT_AUDIT(1, "待审核"),
    WAIT_SUBMIT(2, "待提交"),
    WAIT_PICKUP(3, "待领取"),
    PICKED(4, "已领取"),
    REJECTED(5, "驳回")
    ;

    @EnumValue
    @JsonValue
    private final Integer code;
    private final String message;

    ItemStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }



    public static ItemStatusEnum getEnum(Integer code) {
        for (ItemStatusEnum itemStatusEnum : ItemStatusEnum.values()) {
            if (itemStatusEnum.getCode().equals(code)) {
                return itemStatusEnum;
            }
        }
        return null;
    }
}
